1. Field of the Invention
The present invention relates to a numerical controller that has a backlash compensation function executed for moving axes such as feed axes in machine tools.
2. Description of the Prior Art
Moving axes such as feed axes in machine tools undergo lost motion due to backlash in ball screw/nut mechanisms, gear mechanisms, and other power transmission mechanisms when the direction of motion is reversed. In view of this situation, numerical controllers for controlling machine tools are provided with backlash compensation functions to compensate for the lost motion. These backlash compensation functions output a preset amount of backlash compensation when the direction of motion of an axis is reversed, using one of the following output modes:                (a) outputting a preset compensation all at once when the direction is reversed;        (b) outputting a compensation in amounts according to the distance traveled from the start of the direction reversal;        (c) outputting a compensation in amounts according to the time elapsed from the start of the direction reversal.        
If a large backlash compensation is outputted all at once, mechanical vibration may occur or the machine tool may bite into the workpiece being machined. Two of the modes above prevent these problems by dividing the backlash compensation into parts that are outputted according to the distance traveled or time elapsed from the start of the direction reversal, instead of outputting the backlash compensation all at once.
In backlash compensation, one output mode is usually set in advance and used consistently. To increase the machining accuracy of machine tools controlled by numerical controllers, however, two backlash compensation modes may be provided and used selectively as necessary to compensate for backlash. In this connection, Japanese Patent Application Laid-Open No. 58-68111 discloses a method having a first backlash compensation mode in which backlash compensation is performed before the start of cutting according to the next block command after the completion of cutting according to the current block command, and a second backlash compensation mode in which backlash compensation is performed simultaneously with the start of cutting according to the next block command after the completion of cutting according to the current block command.